<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('盘点记录列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
<!--                            <li>-->
<!--                                <label class="is-required">仓库：</label>-->
<!--                                <select id="warehouseId" name="warehouseId" th:with="type=${session.warehouse}">-->
<!--                                    &lt;!&ndash;								<option   th:value="${session.warehouseId}" th:text="${@dict.getDictLabel('${session.warehouseId}')}"></option>&ndash;&gt;-->
<!--                                    <option th:each="dict : ${type}" th:text="${dict.warehouseName}" th:value="${dict.warehouseId}"></option>-->
<!--                                </select>-->
<!--                            </li>-->

                            <li>
                                <label>仓库：</label>
                                <select name="warehouseId" th:with="type=${@dict.getType('is_house')}" required>
                                    <!--<option value="">请选择</option>-->
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>

                            <li>
                                <label>库存编码：</label>
                                <input type="text" name="stockId"/>
                            </li>
                            <li>
                                <label>托盘条码：</label>
                                <input type="text" name="trayCode"/>
                            </li>
                            <li>
                                <label>货位编码：</label>
                                <input type="text" name="cargoSpaceId"/>
                            </li>
                            <li>
                                <label>物品编码：</label>
                                <input type="text" name="productId"/>
                            </li>

                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('formId','bootstrap-table')"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formId','bootstrap-table')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">

                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="pandian:record:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-bordered">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('pandian:record:edit')}]];
        var removeFlag = [[${@permission.hasPermi('pandian:record:remove')}]];
        var sysOperType = [[${@dict.getType('sys_oper_type')}]];
        var prefix = ctx + "pandian/record";

        $(function() {
            var options = {
                url: prefix + "/list",
                exportUrl: prefix + "/export",
                modalName: "盘点记录",
                clickToSelect: true,//是否启用点击选中行
                uniqueId:"pdGuid",//表主键(用于修改和删除)
                sortName:"createTime",//必加排序 sortOrder: "asc"默认
                sortOrder:"asc",
                columns: [
                    {
                        halign: 'center',
                        align:'center',
                        checkbox: true
                    },
                {
                    title: "序号",
                    halign: 'center',
                    align:'center',
                    width: 55,
                    formatter:function (value, row, index) {
                        //获取每页显示的数量
                        var pageSize = $('#bootstrap-table').bootstrapTable('getOptions').pageSize;
                        //获取当前是第几页
                        var pageNumber = $('#bootstrap-table').bootstrapTable('getOptions').pageNumber;
                        //返回序号，注意index是从0开始的，所以要加上1
                        return pageSize * (pageNumber - 1) + index + 1;

                    }
                },

                {
                    field: 'pdGuid',
                    title: '序号',
                    halign: 'center',
                    align:'center',
                
                    visible: false
                },
                {
                    field: 'stockId',
                    title: '库存编码',
                    halign: 'center',
                    align:'center',
                
                    visible: true
                },
                {
                    field: 'trayCode',
                    title: '托盘条码',
                    halign: 'center',
                    align:'center',
                
                    visible: true
                },
                {
                    field: 'cargoSpaceId',
                    title: '货位名称',
                    halign: 'center',
                    align:'center',
                
                    visible: true
                },
                {
                    field: 'productId',
                    title: '物料编码',
                    halign: 'center',
                    align:'center',
                
                    visible: true
                },{
                    field: 'lineId',
                    title: '物料名称',
                    halign: 'center',
                    align:'center',
                
                    visible: true
                },{
                    field: 'productDetailId',
                    title: '比例号',
                    halign: 'center',
                    align:'center',
                
                    visible: true
                },
                {
                    field: 'lotNo',
                    title: '批号',
                    halign: 'center',
                    align:'center',
                
                    visible: false
                },
                {
                    field: 'supplier',
                    title: '供应商',
                    halign: 'center',
                    align:'center',
                
                    visible: false
                },
                {
                    field: 'unit',
                    title: '单位',
                    halign: 'center',
                    align:'center',
                
                    visible: false
                },
                {
                    field: 'oldQuantity',
                    title: '初始数量',
                    halign: 'center',
                    align:'center',
                
                    visible: true
                },
                {
                    field: 'newQuantity',
                    title: '盘点后数量',
                    halign: 'center',
                    align:'center',
                
                    visible: true
                },
                {
                    field: 'recordType',
                    title: '操作类型',
                    halign: 'center',
                    align:'center',
                
                    visible: true,
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(sysOperType, value);
                    }
                },
                    {
                        field: 'createTime',
                        title: '修改时间',
                        halign: 'center',
                        align:'center',
                    
                        visible: true
                    },
                // {
                //     title: '操作',
                //     halign: 'center',
                //     align: 'center',
                //     formatter: function(value, row, index) {
                //         var actions = [];
                //         actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.pdGuid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                //         actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.pdGuid + '\')"><i class="fa fa-remove"></i>删除</a>');
                //         return actions.join('');
                //     }
                // }
                ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>